unit uFrmModeloCadastros;

interface

uses
  Controls, Windows, Messages, Classes, Forms, ComCtrls, Grids, DBGrids,
  StdCtrls, Buttons, ExtCtrls, DB, uFrmActionHeranca, uAbstractFactoryForm;

Type
  TFabrica = class(TAbstractFactoryFormRegister);

type
  TFrmModeloCadastros = class(TForm)
    PageControl1: TPageControl;
    TabSheet1: TTabSheet;
    StatusBar1: TStatusBar;
    GroupBox1: TGroupBox;
    cbFiltro: TComboBox;
    GroupBox2: TGroupBox;
    EdtValor: TEdit;
    TabSheet2: TTabSheet;
    Bevel1: TBevel;
    BtnNovo: TBitBtn;
    BtnAlterar: TBitBtn;
    BtnCancelar: TBitBtn;
    BtnExcluir: TBitBtn;
    BtnSalvar: TBitBtn;
    BtnSair: TBitBtn;
    DataSource1: TDataSource;
    DBGrid1: TDBGrid;
    DBGrid2: TDBGrid;
    procedure FormShow(Sender: TObject);
    procedure FormKeyPress(Sender: TObject; var Key: Char);
    procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
    procedure FormCreate(Sender: TObject);
    procedure BtnSairClick(Sender: TObject);
  protected
    FAction: TFrmActionHeranca;
  end;

implementation

{$R *.dfm}

procedure TFrmModeloCadastros.BtnSairClick(Sender: TObject);
begin
  close;
end;

procedure TFrmModeloCadastros.FormCreate(Sender: TObject);
begin
  FAction := TFrmActionHeranca.create(self, DataSource1);
end;

procedure TFrmModeloCadastros.FormKeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
  if Key = vk_Escape then
    close;
end;

procedure TFrmModeloCadastros.FormKeyPress(Sender: TObject; var Key: Char);
begin
  if (Key = #13) then
  Begin
    Key := #0;
    Perform(Wm_NextDlgCtl, 0, 0);
  end;
end;

procedure TFrmModeloCadastros.FormShow(Sender: TObject);
begin
  PageControl1.ActivePageIndex := 1;
end;

end.
